Repository navigation
fix(server): Antigravity 1.5 quota errors resume at the reset - #39196
OmarAlex24 wants to merge 1 commit into
Conversation
Antigravity 1.5 writes the upstream error as "STATUS (code NNN): message" followed by Google's JSON body, so the Go-map patterns missed the quota reason and reset time. The turn failed as a plain provider error and usage-limit recovery never armed. The patterns now accept both spellings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Adapt quota credential support from upstream PR pingdotgg#36733, native quota errors from pingdotgg#39196, and watchdog diagnostics from pingdotgg#33596. Native CLI instances ignore stale legacy credentials; packaged servers load keyring bindings through require. Preserve the captured NOT_FOUND 404 message without enabling automatic retries.
Problem
When an Antigravity 1.5 turn hits its individual quota, the thread shows "Provider error: Antigravity stopped this turn because of an error." instead of "Usage limit reached". Because the failure is not
usage_limitand has noresetAt, usage-limit recovery never arms and the thread is not resumed when the quota resets.#28629 and #29594 handle the 1.4.x error step, which renders Google's error as a Go map (
Error 429, Message: …, Status: RESOURCE_EXHAUSTED, Details: [map[… reason:QUOTA_EXHAUSTED]]). Runtime 1.5.12 writes the same error step in a different shape:RESOURCE_EXHAUSTED (code 429): Individual quota reached. … Resets in 2h24m51s., then protobuf bytes, then Google's JSON body ("reason": "QUOTA_EXHAUSTED","quotaResetTimeStamp": "2026-11-19T18:33:55Z"). None of theAntigravityTurnOutcomepatterns match it, soturnFailurefalls through to the generic provider error.Fix
In
AntigravityTurnOutcome.ts:QUOTA_EXHAUSTED,RESET_TIMESTAMP,RESET_DELAYandRETRY_DELAYaccept both the Go map'skey:valueand JSON's"key": "value". The timestamp capture stops at"and,, so the JSON timestamp parses. Without that it would silently fall back to the delay.STATUS_ERRORpattern reads theSTATUS (code NNN): messageheader. It is a fallback forAPI_ERROR, and its groups keepAPI_ERROR's order, soturnFailurechanges by one line. The message capture stops at the first control character, where the protobuf bytes start.How I found it and checked it
I found it in daily use: an Antigravity thread on
gemini-4-neon-xhighran out of quota and showed the provider-error card with no option to continue at reset. The session log's last step (type 17) contained the payload described above.main: the new row inAntigravityTurnOutcome.test.ts(trimmed from the real step, with the trace ID, headers and session ids removed) fails withclass: "provider_error",message: "Antigravity stopped this turn because of an error.", which is exactly what the thread showed. With the fix it returnsusage_limitwithresetAt: "2026-11-19T18:33:55.000Z". The test runs on TestClock, so a delay fallback would produce a 1970 timestamp; this result shows the JSON timestamp itself is parsed.retryDelay, invalid argument, thinking signature) still pass unchanged.watchAntigravityPromptOutcome, appended the real error step, and ran the check.mainreturnsprovider_errorwith noresetAt. This branch returns{ class: "usage_limit", code: "RESOURCE_EXHAUSTED", retryable: true, resetAt: "2026-11-19T18:33:55.000Z" }.vp run check:changedpasses (format, lint, knip, typecheck, tests).I have only observed the
QUOTA_EXHAUSTEDcase in the 1.5 format. A plain 429 rate limit in that format now also takes the existing rate-limit branch throughSTATUS_ERROR, but I have not seen one live.Overlap: #33596 (open) rewrites the
API_ERRORline for 502s, and #39123 (open) adds an empty-output branch. This PR leavesAPI_ERRORuntouched and only adds a fallback next to it, so either one rebases trivially.Written with Claude Opus 5.5 in Claude Code, running inside T3 Code.
🤖 Generated with Claude Code